<?php

/**
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @link http://www.vtem.net
**/
defined('_JEXEC') or die('Restricted access');
if($this->na < $this->news_amount) $this->news_amount = $this->na;
?>

<table class="vtem_news_plus_wapper" id="<?php echo $this->vtem_module_id; ?>" cellspacing="5" width="100%">
<?php for($b=0;(($this->news_amount-($b*$this->news_column))>0);$b++) : ?>
	
	<?php if($b < $news_rows2): ?> 
		<tr valign="top">
	<?php else: ?>
		<tr valign="top" style="display:none; visibility:hidden;">
	<?php endif; ?>
	
	<?php for($c=0;$c<$this->news_column;$c++) : ?>
		<?php
			if($this->news_column == 1)
			{
				$tablecell_class = 'vtem_news_center';
			}
			elseif($this->news_column == 2)
			{
				$tablecell_class = ($c == 0) ? 'vtem_news_left' : 'vtem_news_right';
			}
			else
			{
				if($c == 0)
				{
					$tablecell_class = 'vtem_news_left';
				}
				else
				{
					if($c == ($this->news_column - 1) )
					{
						$tablecell_class = 'vtem_news_right';
					}
					else
					{
						$tablecell_class = 'vtem_news_center';
					}
				}
			}
		?>
			
		<?php if((($b*$this->news_column)+$c) >= count($news_code_html_tab)) : ?>
			<td class="<?php echo $tablecell_class; ?>"></td>
		<?php else : ?>
			<td class="<?php echo $tablecell_class; ?>">
					<?php if(isset($news_code_html_tab[(($b*$this->news_column)+$c)]))echo $news_code_html_tab[(($b*$this->news_column)+$c)];?>
			</td>		
		<?php endif; ?>
	<?php endfor; ?>
		</tr>
<?php endfor; ?>

<?php if($this->show_list == 1 || $this->news_more_in == 1) : ?>
	<tr>
		<td colspan="<?php echo $this->news_column; ?>" class="vtem_morin_wapper">
			<?php if($this->news_more_in == 1) echo '<p class="vtem_news_plus_morein_main">'.$this->more_in_text.'</p>'; ?> 
			<?php if($this->show_list == 1) : ?><ul class="vtem_more_links"><?php echo $news_rest_news_list_tab; ?></ul><?php endif; ?>
		</td>
	</tr>
<?php endif; ?>
</table>